package com.lz.gmall.user.rpc;

import com.lz.gmall.common.result.Result;
import com.lz.gmall.common.result.ResultCodeEnum;
import com.lz.gmall.user.biz.UserAddressBizService;
import com.lz.gmall.user.entity.UserAddress;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 郭运龙
 */
@RestController
@RequestMapping("api/inner/user")
public class UserRpcController {

    @Autowired
    private UserAddressBizService userAddressBizService ;

    /**
     * 获取用户的订单地址
     * @return
     */
    @GetMapping(value = "/getAllUserAddress")
    public Result<List<UserAddress>> getAllUserAddress() {
        List<UserAddress> userAddressList = userAddressBizService.getAllUserAddress() ;
        return Result.build(userAddressList , ResultCodeEnum.SUCCESS) ;
    }
}
